﻿using Biz.Core.Models;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Biz.Core.Providers
{
    /// <summary>
    /// 数据提供者
    /// </summary>
    [AutoRegister]
    public interface IDeviceDataProvider
    {
        /// <summary>
        /// 创建设备并返回
        /// </summary>
        /// <param name="deviceDto">设备信息模型</param>
        /// <returns>返回新设备数据</returns>
        bool CreateDevice(DeviceDto deviceDto);
        /// <summary>
        /// 修改设备并返回
        /// </summary>
        /// <param name="deviceDto"></param>
        /// <returns>返回修改后的设备数据</returns>
        bool UpdateDevice(DeviceDto deviceDto);
        /// <summary>
        /// 删除设备并返回
        /// </summary>
        /// <param name="deviceId"></param>
        /// <returns></returns>
        bool DeleteDevice(string deviceId);
        /// <summary>
        /// 可用性切换(Enabled = !Enabled)
        /// </summary>
        /// <param name="deviceId"></param>
        bool ToggleDevice(string deviceId);
        /// <summary>
        /// 按编号查找一条设备数据
        /// </summary>
        /// <param name="deviceId"></param>
        /// <returns></returns>
        DeviceVo GetDevice(string deviceId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pagedQuery"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<DeviceVo>> QueryDeviceList(PagedQueryObject<SearchModel> pagedQuery);
    }
}
